package com.aaa.controller.tables;

import com.aaa.dao.RoleMapper;
import com.aaa.entity.Role;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

import javax.annotation.Resource;

@RestController
@RequestMapping("role")
public class RoleController {
    @Resource
    RoleMapper roleMapper;
    @RequestMapping("select")
    public Object select(){
        return roleMapper.selectList(null);
    }
    @RequestMapping("insert")
    public Integer insert(Role role){
        return roleMapper.insert(role);
    }
    @RequestMapping("delete")
    public Integer delete(Role role){
        return roleMapper.deleteById(role.getRid());
    }
    @RequestMapping("update")
    public Integer update(Role role){
        return roleMapper.updateById(role);
    }
}
